package com.example.gray.service;

import com.example.gray.entity.User;
import com.example.gray.mapper.UserMapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Gray 2021/12/27-17:57
 */
@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public User getUser(String name){
        return userMapper.getUserByName(name);
    }
    public Integer insertUser(User user){
        return userMapper.insertUser(user);
    }
    public Integer deleteUser(Integer id){
        return userMapper.deleteUser(id);
    }
    public Integer updateUser(User user){return userMapper.updateUser(user);}
}
